/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;
import utilitarios.ConnectionHelper;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import pojo.Matricula;
/**
 *
 * @author guh
 */
public class DaoMatricula implements DAO<Matricula> {

    private Connection conn = null;
    private PreparedStatement pstm = null;
    private ResultSet rs = null;
    Matricula matricula;
    String sql;

    public DaoMatricula() {
        conn = ConnectionHelper.getIntance().getConnection();
    }
    
    
    
    @Override
    public void commit(Matricula beans) throws SQLException {
        
        sql = "insert into matricula (ma_idaluno,ma_idturma,ma_idcurso) values (?,?,?)";
        pstm = conn.prepareStatement(sql);
        
        pstm.setLong(1, beans.getIdAluno());
        pstm.setLong(2, beans.getIdTurma());
        pstm.setLong(3, beans.getIdCurso());
        
        pstm.execute();
        
    }

    @Override
    public Matricula findByName(String name) throws SQLException {
        return matricula;
    }

    @Override
    public void delete(int id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void update(Matricula entidade) throws SQLException {
        
    }
    
}
